<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/jquery.min.js"></script>
    <script src="js/axios.min.js"></script>
    <link rel="stylesheet" href="css/register.css">
    <link rel="stylesheet" href="font/iconfont.css">
    <script>
            window.onload = function() {
                /*720代表设计师给的设计稿的宽度，你的设计稿是多少，就写多少;100代表换算比例，这里写100是
                            为了以后好算,比如，你测量的一个宽度是100px,就可以写为1rem,以及1px=0.01rem等等*/
                getRem(750, 100)
            };
            window.onresize = function() {
                getRem(750, 100)
            };
    
            function getRem(pwidth, prem) {
                var html = document.getElementsByTagName("html")[0];
                var oWidth = document.body.clientWidth || document.documentElement.clientWidth;
                html.style.fontSize = oWidth / pwidth * prem + "px";
            }
    </script>
</head>
<body>
        <header>
            <button class="btn-close">
                <a href="#"><span class="iconfont icon-wudi"></span></a>
            </button>
        </header>
        <section>
            <div class="tit">
                <h4>欢迎登录ELLESHOP</h4>
            </div>
            <div class="regist">
                <div class="ipt-regist">
                    <span>+86</span>
                    <input class="phone" type="text" placeholder="手机号码">
                    <button class="yanzhengma">发送验证码</button>
                </div>
                <input  type="text" placeholder="输入验证码">
                <input type="password" placeholder="输入密码">
            </div>
            <button id="zhuce">注册</button>
            <p>
                <span>已经是会员？</span>
                <a href="login.html">立即登录</a>
            </p>
        </section>
        <footer>
            <p>注册即表示同意用户协议</p>
        </footer>
        <script>
            $(function(){
                let url = `http://106.13.115.175:8080/elleshop/v2/api-docs`;
                $(".yanzhengma").click(function(){
                    axios.post(url,{
                        phone:$(".phone").val()
                    }).then(res=>{
                        
                        console.log(res);
                    })
                });
                $("#zhuce").click(function(){
                    axios.post(url,{
                        code:$("input:eq(1)").val(),
                        phone:$(".phone").val(),
                        password:$("input:eq(2)").val()
                    }).then(res=>{
                        console.log(res)
                        if(res.data.info.version){
                            //location.href = "login.html";
                        }
                    })
                })
            })
        </script>
</body>
</html>